// 引入windi css
import '@/plugins/windi.css'

// 导入全局的svg图标
import '@/plugins/svgIcon'

// 初始化多语言
import { setupI18n, } from '@/plugins/vueI18n'

// 引入状态管理
import { setupStore, } from '@/store'

// 全局组件
import { setupGlobCom, } from '@/components'

// 引入 element-plus
import { setupElementPlus, } from '@/plugins/elementPlus'

// 引入 form-create
import { setupFormCreate, } from '@/plugins/formCreate'

// 引入全局样式
import '@/styles/index.scss'

// 引入动画
import '@/plugins/animate.css'

// 路由
import router, { setupRouter, } from '@/router'

// 权限
import { setupAuth, } from '@/directives'

import { createApp, } from 'vue'

import ArcoVue from '@arco-design/web-vue';

import App from './App.vue'

import '@arco-design/web-vue/dist/arco.css';

import './permission'

import '@/plugins/tongji' // 百度统计

import formCreate from '@form-create/element-ui'
import FcDesigner from '@form-create/designer'

// 创建实例
const setupAll = async () => {
  const app = createApp(App)

  await setupI18n(app)

  setupStore(app)

  setupGlobCom(app)

  setupElementPlus(app)

  setupFormCreate(app)

  setupRouter(app)

  setupAuth(app)

  await router?.isReady()

  app?.mount('#app')

  app.use(formCreate)
  app.use(FcDesigner)
  app.use(ArcoVue);

}

setupAll()
